package com.example.myroomdemo.adapter

import android.content.Context
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.example.myroomdemo.R
import com.example.myroomdemo.beans.Users
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder
import java.util.*

/**
 * Created by LFC
 * on 2019/8/13.
 *   充值金额/ 充值流量
 */
class Adapter_Recharge(
    val baseContext: Context,
    layoutId: Int,
    datas: List<Users>
) :
    CommonAdapter<Users?>(baseContext, layoutId, datas) {
    private var list_data: List<Users> = ArrayList() //
    override fun convert(holder: ViewHolder, commonDataM: Users?, position: Int) {
        holder.setText(R.id.tv_name, commonDataM?.strName) //标题
        holder.setText(
            R.id.tv_info,
            "id ${commonDataM?.roomID} sex ${commonDataM?.sex} age ${commonDataM?.age}  hobby ${commonDataM?.strHobby}  ads ${commonDataM?.adsInfo?.adddressName} " +
                    "books ${commonDataM?.listBooks?.size}"
        ) //标题


    }

    init {
        list_data = datas
    }
}